cmake_minimum_required(VERSION 3.1)#最低版本要求

project( Armadillo_MKL )#工程名称



#Armadillo
option(USE_Armadillo "Need the Armadillo module or not" ON)
mark_as_advanced(USE_Armadillo) # 
set(Armadillo_DIR "" CACHE PATH "Armadillo path")
if( USE_Armadillo )
	message(STATUS "find Armadillo.")
	mark_as_advanced(Armadillo_DIR)
	if(NOT Armadillo_DIR)
		message(FATAL_ERROR "cannot find Armadillo_DIR path.")
	else()
		set(Armadillo_INCLUDE_DIR "${Armadillo_DIR}/include")
		#set(Armadillo_LIBRARY_DIR "${Armadillo_DIR}/examples/lib_win64")
		message(STATUS "    include path: ${Armadillo_INCLUDE_DIR}")
		#message(STATUS "    library path: ${Armadillo_LIBRARY_DIR}")
	endif()
	include_directories(${Armadillo_INCLUDE_DIR})
	#link_directories(${Armadillo_LIBRARY_DIR})
	#link_libraries(${Armadillo_LIBRARY_DIR}/*.lib)
endif()
#MKL
option(USE_MKL "Need the MKL module or not" ON)
mark_as_advanced(USE_MKL) # 
set(MKL_DIR "" CACHE PATH "MKL path")
if( USE_MKL )
	message(STATUS "find MKL.")
	mark_as_advanced(MKL_DIR)
	if(NOT MKL_DIR)
		message(FATAL_ERROR "cannot find MKL_DIR path.")
	else()
		set(MKL_INCLUDE_DIR "${MKL_DIR}/include")
		set(MKL_LIBRARY_DIR "${MKL_DIR}/lib/intel64_win")
		message(STATUS "    include path: ${MKL_INCLUDE_DIR}")
		message(STATUS "    library path: ${MKL_LIBRARY_DIR}")
	endif()
	include_directories(${MKL_INCLUDE_DIR})
	link_directories(${MKL_LIBRARY_DIR})
	#link_libraries(${MKL_LIBRARY_DIR}/*.lib)
endif()

# 设置输出路径
if( NOT LIBRARY_OUTPUT_PATH )
  set( LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin CACHE INTERNAL
    "Single output directory for building all libraries." )
endif()
if( NOT EXECUTABLE_OUTPUT_PATH )
  set( EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin CACHE INTERNAL
    "Single output directory for building all executables." )
endif()
mark_as_advanced( LIBRARY_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH )

# 设置输出路径
message(STATUS "    EXECUTABLE_OUTPUT_PATH path: ${EXECUTABLE_OUTPUT_PATH}")

# 1 拷贝文件夹里的文件
#file(COPY ${Armadillo_LIBRARY_DIR}/blas_win64_MT.dll  DESTINATION ${EXECUTABLE_OUTPUT_PATH}/Debug)
#file(COPY ${Armadillo_LIBRARY_DIR}/lapack_win64_MT.dll  DESTINATION ${EXECUTABLE_OUTPUT_PATH}/Debug)
#file(COPY ${Armadillo_LIBRARY_DIR}/blas_win64_MT.dll  DESTINATION ${EXECUTABLE_OUTPUT_PATH}/Release)
#file(COPY ${Armadillo_LIBRARY_DIR}/lapack_win64_MT.dll  DESTINATION ${EXECUTABLE_OUTPUT_PATH}/Release)

file(GLOB hdr_files  *.h)
file(GLOB src_files  *.cpp *.c)
source_group("Header Files" FILES ${hdr_files})
source_group("Source Files" FILES ${src_files})
add_executable(${PROJECT_NAME} ${hdr_files} ${src_files})





